package com.group18.db;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * 获取数据库工具类
 * @author Nicky
 *
 */
public class DBUtil {
	
	public static Connection getConnection() {
		Connection conn = null;
		String url = "jdbc:mysql://127.0.0.1:3306/family?characterEncoding=utf8";
		String user = "root";
		String password = "root";
		try {
			Class.forName("com.mysql.jdbc.Driver");
			conn = DriverManager.getConnection(url, user, password);
		}catch (Exception e) {
			e.printStackTrace();
		}
		return conn;
	}
	
	
}
